type Size = number | string; //联合类型
let str: Size = '123';
function foo(msg: Size) {
    console.log(msg);
}
interface mySay {
    say: (msg: string) => string;
}

interface myEat {
    eat: (msg: string) => string;
}
// type myFun = mySay | myEat; 联合类型
type myFun = mySay & myEat; //交叉类型

let p1: myFun = {
    say(msg) {
        return msg;
    },
    eat(msg) {
        return msg;
    },
};

interface Foo {
    name: string;
}

interface Foo {
    age: number;
}

let p5: Foo = {
    age: 123,
    name: '1231',
};

// type Width = string;
// type Width = string;
